/**
 * @file bh1750.c
 * @brief 光强传感器
 *
 * @author 钟涛
 *
 * @date 2022-05-09
 *
 * @copyright 海南大学 - 追光者
 */

#include <rtthread.h>
#include <rtdevice.h>
#include "drv_common.h"
#include "app_main.h"
#include "app_bh1750.h"

#define DBG_TAG "bh1750"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>

int test_bh1750(void)
{
    float light_value = bh1750_read_light(hdev);
    LOG_I("light: %d", (int)light_value);

    return 0;
}
MSH_CMD_EXPORT(test_bh1750, test bh1750);

//int bh1750_init(void)
//{
//    i2c_bus = (struct rt_i2c_bus_device *) rt_device_find(BH1750_I2C_BUS_NAME);
//
//    int ret = bh1750_single_write(0x01);
//    if (ret)
//    {
//        LOG_E("bh1750 init fail!");
//    }
//    rt_thread_mdelay(180);
//
//    return ret;
//}
//INIT_DEVICE_EXPORT(bh1750_init);
